﻿@{
    ViewBag.Title = "Test | Home";
}
@section html_head
{
    <style type="text/css">
        #container {
            max-width: 1440px;
            height: 600px;
            margin: auto;
            border: 1px solid #ccc;
        }
    </style>
}

<h2>Test</h2>

<div id="container"></div>

@section scripts
{
<script src="/Scripts/sigma.min.js"></script>
<script src="/Scripts/plugins/sigma.parsers.json.min.js"></script>
<script type="text/javascript">
    (function ($) {
        "use strict";

        var data, s;

        data = {
            "nodes": [
              {
                  "id": "n0",
                  "label": "A node",
                  "x": 0,
                  "y": 0,
                  "size": 3
              },
              {
                  "id": "n1",
                  "label": "Another node",
                  "x": 3,
                  "y": 1,
                  "size": 2
              },
            ],
            "edges": [
              {
                  "id": "e0",
                  "source": "n0",
                  "target": "n1"
              },
            ]
        }

        s = new sigma({
            graph: data,
            container: 'container',
            settings: {
                defaultNodeColor: '#ec5148'
            }
        });

    }(jQuery));


    // This is for readon from a file of json data call 'data.json'
    //sigma.parsers.json('data.json', {
    //    container: 'container',
    //    settings: {
    //        defaultNodeColor: '#ec5148'
    //    }
    //});
</script>
}